<template>
	<view>
		<view class="ceiling" :style="{ 'padding-top': statusBarHeight + 'px' }"></view>
		<uni-nav-bar left-icon="back" title="个人信息" backgroundColor="#EE515A" color="#ffffff" @clickLeft="handleBack"></uni-nav-bar>
		<view class="bg_12161F">
			
			<!-- 修改头像，老板要慢慢的加 -->
			<view class="cu-form-group">
				<view class="title text-black">头像</view>
				<view class="flex justify-end align-center" @tap="tonavigateTo('/pages/member/headSelector')">
					<image :src="userinfo.headImg" mode="widthFix" style="width: 82rpx;border-radius: 50%;"></image>
					<image src="/static/imgs/qidongye_slices/3.png" mode="" class="right-icon"></image>
				</view>
			</view>
			
			<!-- 改名没用了 -->
			<view class="cu-form-group">
				<view class="title text-black">姓名</view>
				<view class="flex justify-end align-center">
					<view class="text-df color_A8AFC2">{{ userinfo.realname ? (userinfo.realname ) : '未认证' }}</view>
					<image src="/static/imgs/qidongye_slices/3.png" mode="" class="right-icon"></image>
				</view>
			</view>
			
			<view class="cu-form-group">
				<view class="title text-black">手机号</view>
				<view class="flex justify-end align-center">
					<view class="text-df color_A8AFC2">{{ userinfo.phone ? (userinfo.phone ) : '请登录' }}</view>
					<image src="/static/imgs/qidongye_slices/3.png" mode="" class="right-icon"></image>
				</view>
			</view>

			<view class="cu-form-group" @click="tonavigateTo('realname')">
				<view class="title text-black">实名认证</view>
				<view class="flex justify-end align-center">
					<image src="/static/imgs/qidongye_slices/3.png" mode="" class="right-icon"></image>
				</view>
			</view>
			
			<view class="cu-form-group" @click="tonavigateTo('changePwd')">
				<view class="title text-black">修改密码</view>
				<view class="flex justify-end align-center">
					<image src="/static/imgs/qidongye_slices/3.png" mode="" class="right-icon"></image>
				</view>
			</view>
			
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				statusBarHeight: getApp().globalData.statusBarHeight, //状态栏高度
				userinfo: {},
			};
		},
		methods: {
			//返回上一级页面
			handleBack() {
				uni.navigateBack({
					delta: 1
				});
			},
			// 跳转页面
			tonavigateTo(url) {
				uni.navigateTo({
					url: url
				})
			},
			// 新增功能
			userInfo: function() {
					this.$Request.get(this.$api.index.userInfo).then(res => {
						// this.login = true;
						this.userinfo = [];
						this.userinfo.phone = res.data.phone
						this.userinfo.money = res.data.money
						this.userinfo.djmoney = res.data.djmoney
						this.userinfo.realname = res.data.realname
						this.userinfo.invitecode = res.data.invitecode
						this.userinfo.headImg = '/static/images/headImg/'+ (res.data.card_pic ? res.data.card_pic : 1)+'.png'
						// this.id = res.data.id;
						// this.code = res.data.invitecode;
						// this.ischeck = res.data.ischeck;
						// this.qqserver = res.qqserver;
					})
			},
		},
		onShow: function() {
			this.userInfo()
		}
	}
</script>

<style lang="scss" scoped>
	@import "./setUp.scss";
	page{
		background-color: #FFFFFF;
	}
	.cu-form-group{
		background-color: #FFFFFF;
		padding-right: 0;
	}
	.right-icon{
		margin-left: 10rpx;
		width: 50rpx;
		height: 50rpx;
	}
	.cu-form-group + .cu-form-group {
	    border-top: 1px solid #EDEDED;
	}
</style>
